package com.faithbj.common_service.dao.impl;

import com.faithbj.common.dao.impl.BaseDaoImpl;
import com.faithbj.common.model.fm.property.*;
import com.faithbj.common_service.dao.FamilyMemberPropertyDao;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository("familyMemberPropertyDao")
public class FamilyMemberPropertyDaoImpl extends BaseDaoImpl<FamilyMemberProperty, String> implements FamilyMemberPropertyDao {

	@SuppressWarnings("unchecked")
	@Override
    public List<FamilyMemberProperty> queryByFmIds(List<String> fmIds) {
        String hql = "select p from FamilyMemberProperty as p " + "where p.fmId in(:fmIds)";
        return getSession().createQuery(hql).setParameterList("fmIds", fmIds).list();
    }
}
